package com.zmx.user.service;

import com.zmx.common.common.service.BaseService;
import com.zmx.user.dto.MemberDto;
import com.zmx.user.entity.Member;
import com.zmx.user.repository.MemberRepository;
import com.zmx.user.service.mapper.MemberMapper;
import org.springframework.stereotype.Service;

/**
@author zhaomxr
*/
@Service
public class MemberService extends BaseService<Member, MemberDto, MemberRepository, MemberMapper>  {

    /**
     * 根据微信openid取用户信息
     * @param openId
     * @return
     */
    public MemberDto findByOpenid(String openid) {
        return entityToDto(repository.findByOpenid(openid));
    }

    public MemberDto findByMemberId(Long memberId) {
        return entityToDto(repository.findById(memberId));
    }
}
